
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>设置</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@1.6/lib/index.css">
		<!-- 引入组件 -->
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
		<script src="https://cdn.jsdelivr.net/npm/vant@1.6/lib/vant.min.js"></script>
		<script src="html5plus://ready"></script>
		<script type="text/javascript" src="../../js/fanhui.js" ></script>
	</head>
	<body>
		<div id="app">
			<header>
				<van-nav-bar @click-left="onClickLeft" style="background-color: red;">
					<van-icon slot="left" name="arrow-left" color="white"></van-icon>
					<label slot="title" style="color: white;">设置</label>
				</van-nav-bar>
			</header>
			<section>
				<a href="xiugai.html">
					<van-cell title="修改密码" is-link @click="alter"/>
				</a>
				<van-cell title="退出" is-link @click="close"></van-cell>
			</section>
			<footer>
				
			</footer>
		</div>
	</body>
	<script>
		var vm = new Vue({
			el:"#app",
			data:{
				
			},
			methods:{
				onClickLeft: function() { //返回个人中心
						plus.webview.close(plus.webview.currentWebview(), "slide-out-left");
					},
				alter:function(){//修改登陆密码
					
				},
				close:function(){
					this.$dialog.confirm({
					  title: '退出登陆',
					  message: '你确定要登陆吗！'
					}).then(() => {
						console.log("确定");
						
						if(plus.storage.getItem("user")==null){
							this.$toast('你还未登陆!');
						}else{
							plus.storage.removeItem("user"); //清除登陆储存 
							this.$toast("退出成功!");
							console.log(plus.storage.getItem("user"));
							var personal = plus.webview.getWebviewById("personal");
							personal.reload();//刷新个人中心页面
						}
						
					}).catch(() => {
						console.log("取消");
						this.$toast('取消!');
					});
				}
			}
		})
	</script>
</html>
